package com.jiazhong.spring.ioc.annotation.b;

import com.jiazhong.spring.ioc.annotation.a.D;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.Configuration;
// 告诉别人，这个类是一个配置类
@Configuration
@ComponentScans(value = {@ComponentScan("com.jiazhong.spring.ioc.annotation.a")})
public class SpringConfig {

    // 手动的将D类的对象产生，并存放到IoC容器中
    @Bean(name = "d")
    public D getD(){
        return new D();
    }
}
